package com.example.demo.proxy;

public class HouseProxy implements HouseSubject {
    private HouseSubject houseSubject;
    public HouseProxy(HouseSubject houseSubject){
        this.houseSubject=houseSubject;
    }


    @Override
    public void rent() {
        System.out.println("我是代理人，开始代理");
        houseSubject.rent();
        System.out.println("我是代理人，结束代理");
    }

    @Override
    public void sale() {
        System.out.println("我是代理人，开始代理");
        houseSubject.sale();
        System.out.println("我是代理人，结束代理");
    }
}
